const Sequelize = require('sequelize')
const dbConn = require('../plugins/db')

module.exports = dbConn.define('group', {
  groupName: {
    type: Sequelize.STRING,
    comment: '分组名称'
  },
  permission: {
    type: Sequelize.STRING,
    comment: '权限ID',
    set (val) {
      this.setDataValue('permission', val.join(','))
    },
  },
  remarks: {
    type: Sequelize.STRING,
    comment: '备注'
  }
}, {
  tableName: 'SysGroup',
  comment: '分组'
})
